import React from 'react'
import {connect} from 'react-redux'
import { TopicWrapper,TopicItem } from '../style'
 class Tipic extends React.PureComponent{
    render(){
        return(
            <TopicWrapper>
                {this.props.list.map((item)=>{
                        return(
                                <TopicItem key={item.get('id')}>
                                    <img 
                                    className='TopicImg' 
                                    src={item.get('imgUrl')}alt=""/>
                                    {item.get('tielel')}
                                </TopicItem>
                )
            })
                }
                
            </TopicWrapper>
        )
    }
}

const mapState = (state) =>({
    list:state.get('home').get('topicList')
})
export default connect(mapState,null)(Tipic)